package com.suse.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
@TableName(value = "employee")
public class Employee {
    @TableId(value = "employee_id", type = IdType.AUTO)
    private Integer employeeId;

    @TableField(value = "employee_name")
    @Size(min = 1, max = 10,message = "姓名长度必须在1-10之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,10}$",message = "姓名必须为中文")
    private String employeeName;

    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$", message = "密码必须包含字母和数字，且至少8位")
    private String employeePassword;

    @Pattern(regexp = "^[01]$", message = "角色只能是0或1")
    private String employeeRole;

    @Pattern(regexp = "^[01]$", message = "性别只能是0或1")
    private String employeeGender;

    @Pattern(regexp = "^\\d{4}-\\d{1,2}-\\d{1,2}",message = "日期格式错误，应为yyyy-MM-dd")
    private String employeeBirth;

    @Pattern(regexp = "^\\d{11}$",message = "手机号码格式错误，应为11位数字")
    private String employeePhone;

    @Pattern(regexp = "^[\\w-]+@[\\w-]+\\.(com|cn|net)",message = "邮箱格式错误")
    private String employeeEmail;

    @NotBlank(message = "学历不能为空，且必须为中文")
    @Size(min = 1, max = 10, message = "学历长度必须在1-10之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]+$", message = "学历必须为中文")
    private String employeeEducation;

    @NotBlank(message = "部门不能为空，且必须为中文")
    @Size(min = 1, max = 10, message = "部门长度必须在1-10之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]+$", message = "部门必须为中文")
    private String employeeDepartment;

    @NotBlank(message = "职位不能为空，且必须为中文")
    @Size(min = 1, max = 10, message = "职务长度必须在1-10之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]+$", message = "职位必须为中文")
    private String employeePosition;

    private String src;

    @TableLogic
    private Integer deleteTag;
}
